.class public Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;
.super Ljava/lang/Object;
.source "DisplayTrackInMapPolyline.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;
    }
.end annotation


# instance fields
.field private displayer:Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;

.field private handler:Landroid/os/Handler;

.field private loader:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

.field private model:Llt/noframe/gpsfarmguide/models/MeasuringModel;

.field private polys:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/Polyline;",
            ">;"
        }
    .end annotation
.end field

.field private track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;


# direct methods
.method public constructor <init>(Llt/noframe/gpsfarmguide/models/MeasuringModel;Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;)V
    .locals 0

    .line 34
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 35
    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->model:Llt/noframe/gpsfarmguide/models/MeasuringModel;

    .line 36
    iput-object p2, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    .line 37
    new-instance p1, Landroid/os/Handler;

    invoke-direct {p1}, Landroid/os/Handler;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->handler:Landroid/os/Handler;

    return-void
.end method

.method static synthetic access$000(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;
    .locals 0

    .line 25
    iget-object p0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->displayer:Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;

    return-object p0
.end method

.method static synthetic access$002(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;)Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;
    .locals 0

    .line 25
    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->displayer:Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;

    return-object p1
.end method

.method static synthetic access$100(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;)Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;
    .locals 0

    .line 25
    iget-object p0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    return-object p0
.end method

.method static synthetic access$200(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;)Ljava/util/List;
    .locals 0

    .line 25
    iget-object p0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    return-object p0
.end method

.method static synthetic access$202(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;Ljava/util/List;)Ljava/util/List;
    .locals 0

    .line 25
    iput-object p1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    return-object p1
.end method

.method static synthetic access$300(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;)Landroid/os/Handler;
    .locals 0

    .line 25
    iget-object p0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->handler:Landroid/os/Handler;

    return-object p0
.end method

.method private changeWidth()V
    .locals 13

    .line 60
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    if-eqz v0, :cond_1

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_1

    .line 62
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v1

    const/4 v2, 0x1

    sub-int/2addr v1, v2

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v0

    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v3

    sub-int/2addr v3, v2

    invoke-interface {v1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->getPoints()Ljava/util/List;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    sub-int/2addr v1, v2

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/maps/model/LatLng;

    .line 64
    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->getImpelement()D

    move-result-wide v3

    double-to-float v1, v3

    .line 65
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v3

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v3

    invoke-virtual {v3}, Lcom/google/android/gms/maps/GoogleMap;->getProjection()Lcom/google/android/gms/maps/Projection;

    move-result-object v3

    .line 66
    invoke-virtual {v3, v0}, Lcom/google/android/gms/maps/Projection;->toScreenLocation(Lcom/google/android/gms/maps/model/LatLng;)Landroid/graphics/Point;

    move-result-object v4

    .line 67
    new-instance v5, Landroid/graphics/Point;

    iget v6, v4, Landroid/graphics/Point;->x:I

    add-int/lit16 v6, v6, 0x12c

    iget v4, v4, Landroid/graphics/Point;->y:I

    invoke-direct {v5, v6, v4}, Landroid/graphics/Point;-><init>(II)V

    invoke-virtual {v3, v5}, Lcom/google/android/gms/maps/Projection;->fromScreenLocation(Landroid/graphics/Point;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v3

    .line 68
    new-array v2, v2, [F

    if-eqz v0, :cond_1

    if-eqz v3, :cond_1

    .line 70
    iget-wide v4, v0, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v6, v0, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    iget-wide v8, v3, Lcom/google/android/gms/maps/model/LatLng;->latitude:D

    iget-wide v10, v3, Lcom/google/android/gms/maps/model/LatLng;->longitude:D

    move-object v12, v2

    invoke-static/range {v4 .. v12}, Landroid/location/Location;->distanceBetween(DDDD[F)V

    const/4 v0, 0x0

    .line 71
    aget v0, v2, v0

    const/high16 v2, 0x43960000    # 300.0f

    div-float/2addr v0, v2

    div-float/2addr v1, v0

    .line 73
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/google/android/gms/maps/model/Polyline;

    .line 74
    invoke-virtual {v2}, Lcom/google/android/gms/maps/model/Polyline;->getWidth()F

    move-result v3

    cmpl-float v3, v3, v1

    if-eqz v3, :cond_0

    .line 75
    invoke-virtual {v2, v1}, Lcom/google/android/gms/maps/model/Polyline;->setWidth(F)V

    goto :goto_0

    :cond_1
    return-void
.end method


# virtual methods
.method public displayTracks()V
    .locals 1

    .line 42
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->loader:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;->isRunning()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 43
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->loader:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;->cancel()V

    .line 46
    :cond_0
    new-instance v0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

    invoke-direct {v0, p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;-><init>(Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->loader:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

    .line 47
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->loader:Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline$LoadPolylines;->start()V

    return-void
.end method

.method public getArea()D
    .locals 2

    .line 181
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->displayer:Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/spray/SprayDisplayerUsingPolyline;->getArea()D

    move-result-wide v0

    return-wide v0
.end method

.method public getPolys()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Lcom/google/android/gms/maps/model/Polyline;",
            ">;"
        }
    .end annotation

    .line 177
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    return-object v0
.end method

.method public getTrack()Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;
    .locals 1

    .line 173
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    return-object v0
.end method

.method public onCameraIdle()V
    .locals 0

    return-void
.end method

.method public onCameraMove()V
    .locals 0

    .line 52
    invoke-direct {p0}, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->changeWidth()V

    return-void
.end method

.method public removePolygons()V
    .locals 2

    .line 165
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->track:Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/sprayer/track/ModelTrack;->removePath()V

    .line 166
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    if-eqz v0, :cond_1

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-lez v0, :cond_1

    const/4 v0, 0x0

    .line 167
    :goto_0
    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v0, v1, :cond_1

    .line 168
    iget-object v1, p0, Llt/noframe/gpsfarmguide/sprayer/spray/DisplayTrackInMapPolyline;->polys:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/google/android/gms/maps/model/Polyline;

    invoke-virtual {v1}, Lcom/google/android/gms/maps/model/Polyline;->remove()V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_1
    return-void
.end method
